package com.itmuyue.demo.controller;

import com.itmuyue.demo.entity.Name;
import com.itmuyue.demo.mapper.NameMapper;
import com.itmuyue.demo.service.NameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class NameController {
    @Autowired
    private NameService nameService;
    @GetMapping("/name")
    public List<Name> query(){
        return nameService.list();
    }
    @PostMapping("/add")
    public Boolean add(Name name){
        return nameService.save(name);
    }
}
